package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;

/**
 * 商品实体类
 */
public class ProductBean {
    /**编号*/
    private int id;
    /**商品名*/
    private String name;
    /**单价*/
    private int price;
    /**产地*/
    private String origin;
    /**生产日期*/
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate date;
    /**图片的路径*/
    private String imgPath;
    /**已销售的数量*/
    private int soldNum;

    @Override
    public String toString() {
        return "ProductBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", origin='" + origin + '\'' +
                ", date=" + date +
                ", imgPath='" + imgPath + '\'' +
                ", soldNum=" + soldNum +
                "}\n";
    }

    public ProductBean() {
    }

    public ProductBean(String name, int price, String origin, LocalDate date, String imgPath) {
        this.name = name;
        this.price = price;
        this.origin = origin;
        this.date = date;
        this.imgPath = imgPath;
    }


    public int getSoldNum() {
        return soldNum;
    }

    public void setSoldNum(int soldNum) {
        this.soldNum = soldNum;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }
}
